local SuperRankAvatarHeadRender = app.mvc.createRenderClass(...)

--data =
function SuperRankAvatarHeadRender.create(node)
    local sprite = SuperRankAvatarHeadRender.extend(node or cc.CSLoader:createNode(Res.SuperRankAvatarHead))
    if node == nil then
        ccui.Helper:doLayout(sprite)
    end
    sprite:init()
    return sprite
end

function SuperRankAvatarHeadRender:init(data)
    self.super.init(self, data)
    -- self._ui["data_1/Panel_rank"]:setAnchorPoint(cc.p(0, 0.5))
    -- self._ui["data_1/Text_name"]:setAnchorPoint(cc.p(0, 0.5))
end

function SuperRankAvatarHeadRender:refresh()
    if not self._data then
        return
    end
    local data = self._data
    self._ui["data_1/Text_name"]:setString(data.value1)
    self._ui["data_1/server"]:setString(data.value2)
    if data.value3 and data.value3 ~= "" then
        self._ui["data_1/num"]:setString(data.value3)
        self._ui["data_1"]:setPositionY(0)
    else
        self._ui["data_1/num"]:setString("")
        self._ui["data_1"]:setPositionY(-28)
    end
end

return SuperRankAvatarHeadRender